
<?php

class Person{
        private $name;
	private $position;
	private $selary;
	
	public function __construct($name = "",$position = "",$selary = 0){
	   $this->name = $name;
	   $this->position = $position; 
	   $this->selary = $selary;
	}
}

$person1 = new Person("Stoqn","1","200");
$person2 = new Person("Mariq","1","250");
$person3 = new Person("Slavi","4","300");

$people =array($person1,$person2,"something",$person3);
var_dump($people);
class Bank {
	private $people;
	
	public function __construct($people) {
		$this->people = $people;
	}
	
	public function findTheDifferentObject() {
		for(var $i=0; $i< count($this->people); $i++) {
			if(get_class($this->people[$i]) != "Person") {
				return $i;
			}
		}
	}
	
	public function makeNewArray() {
		$differentObjectIndex = $this->findTheDifferentObject();
		unset($this->people[$differentObjectIndex]);
		return $this->people;
	}
	
	public function printMethods($person) {
		$refl = new ReflectionClass($person);
		$methods = $refl->getMethods();
		foreach($methods as $method) {
			echo $method->getName() . "<br />";
		}
	}
}
?>
